package com.nine.pesys.model.service.impl;

import com.nine.pesys.base.BaseSupportImpl;
import com.nine.pesys.model.entity.*;
import com.nine.pesys.model.service.EquipmentImformationService;
import org.hibernate.criterion.Restrictions;
import org.springframework.stereotype.Service;
import org.springframework.transaction.annotation.Transactional;

import java.util.List;

/**
 * Created by L先森 on 2014/12/27.
 */
@Service
@Transactional
@SuppressWarnings("all")
public class EquipmentImformationServiceImpl extends BaseSupportImpl<EquipmentImformation> implements EquipmentImformationService{


    @Override
    public List<EquipmentImformation> getByUGId(User user, Game game, EquipmentDetail equipmentDetail) {
        list = this.getSession().createCriteria(EquipmentImformation.class)
                .add(Restrictions.and(
                        Restrictions.eq("user",user),
                        Restrictions.eq("game",game),
                        Restrictions.eq("equipmentDetail",equipmentDetail)
                ))
                .list();
        return list;
    }
}
